package com.logger.loader;

import com.logger.Logger;
import com.logger.Option;

/**
 * 加载配置
 * Created by chenxunlin01 on 2016/1/16.
 */

public class ConfigLoader {

    public static final String CONFIG_FILE = "log.properties";

    public void initConfig() {
        Loader loader = Logger.evnConfig.getLoader();
        loader.loadConfig();
        initOptions();
    }

    private synchronized void initOptions() {
        Option root = Logger.config.getRoot();
        root.buildHandlers();
        for (Option option : Logger.config.getOptions().values()) {
            option.buildHandlers();
        }
    }

}
